<%@ page language="java" import="java.util.*,java.sql.*,com.ruohi.util.dbutil.*,com.ruohi.util.common.*,com.ruohi.manage.*" pageEncoding="UTF-8"%>
<%
	Connection connection = null;
	DBHelper dbHelper = DBHelper.getInstance();
	Map model = new HashMap();
	Map categorys = new TreeMap();
	String tableName = "gift_cherry_schedule";
	String channelUUID = CommonString.getFormatPara(request.getParameter("channel_uuid"));
	Map adminInfo = (Map)session.getAttribute("adminInfo");
	try{
		connection = PoolManager.getConnection(DBType.getDBTypeByEnum("106013"));
		String id = CommonString.getFormatPara(request.getParameter("id"));
		if(null!=id&&!"".equals(id)){
			model = dbHelper.getMap(" select gift_cherry_schedule.*,(select nick_name from gift_member where gift_cherry_schedule.mem_no=gift_member.mem_no) as nick_name,(select mem_name from gift_member where gift_cherry_schedule.mem_no=gift_member.mem_no) as mem_name from "+tableName+" where uuid = ? ",new Object [] {id} , connection);
		}
		if("".equals(channelUUID)&&null!=model){
			channelUUID = (String)model.get("channel_uuid");
		}
		
		Map cherryTypeMap = new TreeMap();
		cherryTypeMap.put("", "请选择品种");
		cherryTypeMap.putAll(CommonApplication.getEnumChildren("175", application));
		Map statusMap = new TreeMap();
		statusMap.put("", "请选择处理状态");
		statusMap.putAll(CommonApplication.getEnumChildren("178", application));
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><%=Env.getInstance().getProperty("project_name") %></title>
<link rel="stylesheet" type="text/css" href="/plugin/other/highslide/highslide.css" />
<link href="/plugin/ui/ligerUI/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
<link href="/plugin/ui/ligerUI/ligerUI/skins/Gray/css/all.css" rel="stylesheet" type="text/css" />
<link href="/plugin/ui/ligerUI/ligerUI/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
<link href="/backend/style/style.css" rel="stylesheet" type="text/css" />
<script src="/plugin/jquery/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="/plugin/area/city/citys.js"></script>
<script type="text/javascript" charset="utf-8" src="/plugin/editor/ueditor/editor_config.js"></script>
<script type="text/javascript" charset="utf-8" src="/plugin/editor/ueditor/editor_all_min.js"></script>
<link rel="stylesheet" type="text/css" href="/plugin/editor/ueditor/themes/default/ueditor.css"/>
</head>

<body style="margin: 0;padding: 0;">
<form name="theform" id="theform" action="/backend/action/crud.jsp?enumNo=106013">
  <div class="formDiv">
    <div class="group"> <span><img src="/plugin/ui/ligerUI/ligerUI/skins/icons/communication.gif" /></span> <span class="groupTitle">预定信息</span> </div>
    <div class="formLeft">预定时间</div>
    <div class="formRight" style="width:190px; text-align:left;">
      <label><%=CommonDate.getFormatDate("yyyy-MM-dd HH:mm", model.get("add_date")) %></label>
    </div>
    <div class="formLeft" style="width:150px;">预定人会员号/昵称/姓名</div>
    <div class="formRight" style="width:190px; text-align:left;">
      <label><%=CommonString.getFormatPara(model.get("mem_no")) + "/" + (CommonString.getFormatPara(model.get("nick_name")).equals("") ? "暂无" : CommonString.getFormatPara(model.get("nick_name"))) + "/" + (CommonString.getFormatPara(model.get("mem_name")).equals("") ? "暂无" : CommonString.getFormatPara(model.get("mem_name"))) %></label>
    </div>
    <div style="clear:left;"></div>
    <div class="formLeft"><span style="color:#F00">* </span>预定品种</div>
    <div class="formRight" style="width:190px">
      <select class="jr_select" id="zd_cherry_type" name="zd_cherry_type" dataType="Require" msg="请选择预定品种">
      	<%=CommonForm.createSelect(cherryTypeMap, CommonString.getFormatPara(model.get("cherry_type"))) %>
      </select>
    </div>
    <div style="clear:left;"></div>
    <div class="formLeft"><span style="color:#F00">* </span>数量(斤)</div>
    <div class="formRight" style="width:190px">
      <input type="text" dataType="Integer" msg="预定数量必须为数字" name="zd_count" class="jr_text" id="zd_count" value="<%=CommonString.getFormatInt(model.get("count")) %>" maxlength="10" />
    </div>
    <div style="clear:left;"></div>
    <div class="group"> <span><img src="/plugin/ui/ligerUI/ligerUI/skins/icons/communication.gif" /></span> <span class="groupTitle">联系信息</span> </div>
    <div class="formLeft"><span style="color:#F00">* </span>联系人</div>
    <div class="formRight" style="width:190px">
      <input type="text" dataType="Require" msg="请输入联系人姓名" class="jr_text" name="zd_link_man" id="zd_link_man" value="<%=CommonString.getFormatPara(model.get("link_man")) %>" maxlength="50"/>
    </div>
    <div style="clear:left;"></div>
    <div class="formLeft"><span style="color:#F00">* </span>联系电话</div>
    <div class="formRight" style="width:190px">
    	<input type="text" dataType="Require" msg="请输入正确的联系电话" class="jr_text" id="zd_link_phone" name="zd_link_phone" value="<%=CommonString.getFormatPara(model.get("link_phone")) %>" maxlength="20" />
	</div>
	<div style="clear:left;"></div>
    <div class="formLeft"><span style="color:#F00">* </span>送货地址</div>
    <div class="formRight" style="text-align:left;">
      <select name="zd_province" id="zd_province" onchange="set_city(this,this.value,theform.zd_city,'');" style="width: 80px;" class="jr_select" dataType="Require" msg="请选择省份">
	       <option value="">选择省</option>
	       <option value="安徽">安徽</option>
	       <option value="北京">北京</option>
	       <option value="重庆">重庆</option>
	       <option value="福建">福建</option>
	       <option value="甘肃">甘肃</option>
	       <option value="广东">广东</option>
	       <option value="广西">广西</option>
	       <option value="贵州">贵州</option>
	       <option value="海南">海南</option>
	       <option value="河北">河北</option>
	       <option value="黑龙江">黑龙江</option>
	       <option value="河南">河南</option>
	       <option value="湖北">湖北</option>
	       <option value="湖南">湖南</option>
	       <option value="内蒙古">内蒙古</option>
	       <option value="江苏">江苏</option>
	       <option value="江西">江西</option>
	       <option value="吉林">吉林</option>
	       <option value="辽宁">辽宁</option>
	       <option value="宁夏">宁夏</option>
	       <option value="青海">青海</option>
	       <option value="山西">山西</option>
	       <option value="山东">山东</option>
	       <option value="上海">上海</option>
	       <option value="四川">四川</option>
	       <option value="天津">天津</option>
	       <option value="西藏">西藏</option>
	       <option value="新疆">新疆</option>
	       <option value="云南">云南</option>
	       <option value="浙江">浙江</option>
	       <option value="陕西">陕西</option>
	    </select>
	    <select name="zd_city" id="zd_city" style="width: 75px;" class="jr_select" dataType="Require" msg="请选择城市">
	    	<option value="">选择市</option>
	  	</select>
	  	<input type="text" style="width:250px;" id="zd_ship_address" name="zd_ship_address" maxlength="50" class="jr_text" dataType="Require" msg="请输入送货地址" value="<%=CommonString.getFormatPara(model.get("ship_address")) %>" />
		<script type="text/javascript">
			$("#zd_province").val("<%=CommonString.getFormatPara(model.get("province")) %>");
			$("#zd_province").change();
			$("#zd_city").val("<%=CommonString.getFormatPara(model.get("city")) %>");
		</script>
    </div>
	  <div style="clear:left;"></div>
	  <div class="formLeft">备注</div>
	  <div class="formRight" style="text-align:left; height:75px;">
	    	<textarea style="width:400px; height:60px;" id="zd_remark" name="zd_remark" maxlength="500"><%=CommonString.getFormatPara(model.get("remark")) %></textarea>
	  </div>
	  <div style="clear:left;"></div>
	  <div class="group"> <span><img src="/plugin/ui/ligerUI/ligerUI/skins/icons/communication.gif" /></span> <span class="groupTitle">处理信息</span> </div>
	  <div class="formLeft"><span style="color:#F00">* </span>处理状态</div>
	  <div class="formRight" style="width:200px">
	    	<select id="zd_status" name="zd_status" class="jr_select" dataType="Require" msg="请选择处理状态">
	    		<%=CommonForm.createSelect(statusMap, CommonString.getFormatPara(model.get("status"))) %>
	    	</select>
	  </div>
	  <div style="clear:left;"></div>
	  <div class="formLeft">处理结果</div>
	  <div class="formRight" style="text-align:left;">
	    	<textarea style="width:400px; height:60px;" id="zd_msg" name="zd_msg" maxlength="500"><%=CommonString.getFormatPara(model.get("msg")) %></textarea>
	  </div>
  </div>
  <input type="hidden" name="tableName" id="tableName" value="<%=tableName %>" />
  <input type="hidden" name="zd_id" id="zd_id" value="<%=CommonString.getFormatPara(model.get("id")) %>" />
</form>
</body>
</html>
<script type="text/javascript" src="/plugin/jquery/jquery.form.js"></script>
<script src="/plugin/ui/ligerUI/ligerUI/js/ligerui.min.js" type="text/javascript"></script>
<script src="/backend/scripts/common.js?tab" type="text/javascript"></script>
<script src="/plugin/validator/wofoshan/validator.min.js" type="text/javascript"></script>
<script type="text/javascript">
	function doSub(){
		var rs = Validator.Validate(document.getElementById("theform"),1);
		if(rs){
			jQuery("#theform").ajaxSubmit({
				type : "POST",
				async : false ,
				success : function(data) {
					var rs = parseInt(jQuery.trim(data), 10);
					if (rs > 0) {
						jrSuccess("保存成功！");
						<%
						if("".equals(id)){
							%>
						window.location.reload();
							<%
						}
						%>
					}
				}
			});
		}
	}
</script>
<%
	}catch(Exception e){
		e.printStackTrace();
	}finally{
		dbHelper.freeConnection(connection);
	}
%>